package com.kangtu.demointerceptor02.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: demo-weix-pay
 * @description: WebConfig
 * @author: 亮子说编程
 * @create: 2021-03-05 18:40
 **/
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new ApiInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/admin")
                .excludePathPatterns("/admin/login");
    }
}

